﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Media;

namespace AngryNerds
{
    class Pig
    {
        public Texture2D myTexture;
        public Vector2 myPosition;
        public Color[] myTextureData;

        private int mode = 0;

        public void Draw(SpriteBatch spriteBatch)
        {
            int axisY = mode * 89;
            Rectangle r = new Rectangle(0, axisY, 93, 89);
            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
            spriteBatch.Draw(myTexture, myPosition, r, Color.White);
            spriteBatch.End();
            
        }

        public Rectangle BoundingBox()
        {
            return new Rectangle(
            (int)myPosition.X,
            (int)myPosition.Y,
            myTexture.Width,
            myTexture.Height/3);
        }

        public void IncMode()
        {
            mode++;
        }

        public bool IsDeath()
        {
            if (mode == 2) return true;
            return false;
        }
    }
}
